package cn.hnu.qq.client.controller;

import java.io.IOException;

import cn.hnu.qq.entity.message.CreateCrowdMessage;


public class CreateCrowdController extends CenterController {

	public static CreateCrowdController instance;
	
	private CreateCrowdController() {
	} 
	
	public synchronized static CreateCrowdController getInstance(){
		if(instance == null){
			instance = new CreateCrowdController();
		}
		return instance;
	}

	public void createCrowd(String crowdName) {
		CreateCrowdMessage ccm = new CreateCrowdMessage();
		ccm.setCrowdName(crowdName);
		ccm.setUser(getCurUser().getAcount());
		try {
			getOutput().writeObject(ccm);
			getOutput().flush();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
}
